<%@ page language="java" import="java.sql.*" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>修改预案信息</title>
</head>
<body>
<%
Connection con = null;
Statement st =null;
ResultSet rs = null;
try{
	Class.forName("com.mysql.jdbc.Driver");
	con = DriverManager.getConnection("jdbc:mysql://localhost:3306/1","root","lishanshan");
	st=con.createStatement();
	request.setCharacterEncoding("UTF-8");
	int id=(Integer.parseInt(request.getParameter("id")));
	
	String sql ="select * from person where id='"+id+"'";
	rs= st.executeQuery(sql);
	if(rs.next()){
		request.setAttribute("name",rs.getString("name"));
		request.setAttribute("label",rs.getString("label"));
		request.setAttribute("identity",rs.getString("identity"));
		request.setAttribute("birthday",rs.getString("birthday"));
		request.setAttribute("descriptions",rs.getString("descriptions"));
		RequestDispatcher rd = request.getRequestDispatcher("updata.jsp");
		rd.forward(request,response);
	}else{
		out.println("没有找到编号为"+id+"的预案记录");
	}
}catch(SQLException e){
	e.printStackTrace();
}finally{
	try{
		rs.close();
		st.close();
		con.close();
	}catch (SQLException e){
		e.printStackTrace();
	}
}
%>
</body>
</html>